#coding: utf-8
"""
prerequisite:
    based on Python 2.7.8, django 1.6
usage:
    1) base url config file in django
process: *
know issues: *
"""
from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

from major import views as major_views
from questioin import views as question_views

urlpatterns = patterns(
    '',
    url(r'^admin/', include(admin.site.urls)),
    #major
    url(r'^major/', major_views.major_all_list),
    url(r'^major/(?P<major_id>\d+)/', major_views.major_in_id),
    url(r'^major/(?P<major_id>\d+)/char/', major_views.char_in_major),
    url(r'^major/(?P<major_id>\d+)/char/(?P<char_id>\d+)/', major_views.char_with_id),
    #url(r'^major/(?P<major_id>\d+)/itype/', question_views.itype_in_major),
    #url(r'^major/(?P<major_id>\d+)/itype/(?P<itype_id>\d+)/', question_views.itype_with_id),
)

#for devloping env
from django.conf import settings
urlpatterns += patterns(
    "",
    url(r'^static/(?P<path>.*)$',
        'django.views.static.serve',
        {'document_root': settings.STATIC_ROOT},),
    url(r'^upload/(?P<path>.*)$',
        'django.views.static.serve',
        {'document_root': settings.UPLOAD_ROOT},),
    )

